Skip to content

[fix](cloud) Fail closed on unknown MetaService response codes - #66364

Open
wyxxxcat wants to merge 2 commits into
apache:masterfrom
wyxxxcat:fix_old_client_ms_code
Open

[fix](cloud) Fail closed on unknown MetaService response codes#66364
wyxxxcat wants to merge 2 commits into
apache:masterfrom
wyxxxcat:fix_old_client_ms_code

Conversation

@wyxxxcat

@wyxxxcat wyxxxcat commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary: Meta Service responses contain both an exact actual_code and a
legacy-compatible code. When a client recognizes the actual_code, it should use
that exact value. When actual_code is unknown, the legacy code is safe only if
it is explicitly present and non-OK. The previous logic could fall back to an
unset or OK code and incorrectly treat an unknown Meta Service error as success.
This change makes BE and FE fail closed with UNDEFINED_ERR in that case, while
preserving compatible non-OK fallbacks. It also adds a message explaining the
MS_TOO_BUSY to KV_TXN_CONFLICT conversion for legacy clients.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@wyxxxcat
wyxxxcat force-pushed the fix_old_client_ms_code branch 3 times, most recently from 9de76ba to d0aa93c Compare August 3, 2026 03:53
@wyxxxcat
wyxxxcat marked this pull request as ready for review August 3, 2026 03:53
@wyxxxcat
wyxxxcat force-pushed the fix_old_client_ms_code branch from d0aa93c to aeed3c8 Compare August 3, 2026 03:59
@wyxxxcat

wyxxxcat commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

Comment thread cloud/src/meta-service/meta_service_helper.h Outdated
@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.29% (25709/43361)
Line Coverage 43.34% (258037/595362)
Region Coverage 39.03% (204567/524141)
Branch Coverage 40.37% (93359/231234)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 81.82% (9/11) 🎉
Increment coverage report
Complete coverage report

@wyxxxcat
wyxxxcat force-pushed the fix_old_client_ms_code branch from aeed3c8 to 7037019 Compare August 3, 2026 06:11
@wyxxxcat

wyxxxcat commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@wyxxxcat
wyxxxcat force-pushed the fix_old_client_ms_code branch 2 times, most recently from f5606b1 to 64dad43 Compare August 3, 2026 07:13
@wyxxxcat

wyxxxcat commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 100.00% (8/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.57% (1912/2465)
Line Coverage 64.53% (34220/53027)
Region Coverage 64.44% (17278/26812)
Branch Coverage 53.94% (9251/17150)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 81.82% (9/11) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.27% (25709/43374)
Line Coverage 43.34% (258103/595519)
Region Coverage 39.03% (204633/524345)
Branch Coverage 40.37% (93380/231288)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.83% (32074/42300)
Line Coverage 60.50% (357869/591522)
Region Coverage 57.06% (300191/526103)
Branch Coverage 58.52% (135370/231322)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 1.92% (1/52) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.88% (32096/42300)
Line Coverage 60.55% (358173/591522)
Region Coverage 57.10% (300413/526103)
Branch Coverage 58.55% (135448/231322)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 1.92% (1/52) 🎉
Increment coverage report
Complete coverage report

@wyxxxcat
wyxxxcat force-pushed the fix_old_client_ms_code branch from 64dad43 to d5c450e Compare August 5, 2026 09:07
@wyxxxcat

wyxxxcat commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 100.00% (8/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.58% (1913/2466)
Line Coverage 64.53% (34219/53032)
Region Coverage 64.43% (17279/26819)
Branch Coverage 53.93% (9252/17154)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 9.09% (1/11) 🎉
Increment coverage report
Complete coverage report

@wyxxxcat

wyxxxcat commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 100.00% (8/8) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.58% (1913/2466)
Line Coverage 64.50% (34205/53032)
Region Coverage 64.38% (17267/26819)
Branch Coverage 53.92% (9249/17154)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29135 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 9b7c7f3bb9fb3ac08fcdafc0e330eacbf6559da1, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17724	4072	4010	4010
q2	1996	344	214	214
q3	10225	1450	813	813
q4	4685	470	337	337
q5	7482	844	568	568
q6	188	175	142	142
q7	792	794	614	614
q8	9348	1564	1586	1564
q9	5412	4081	4084	4081
q10	6798	1626	1398	1398
q11	495	358	342	342
q12	734	590	471	471
q13	18078	3397	2761	2761
q14	266	250	246	246
q15	q16	731	734	669	669
q17	994	1061	895	895
q18	6622	5636	5627	5627
q19	1294	1248	1069	1069
q20	819	699	576	576
q21	5532	2677	2436	2436
q22	455	363	302	302
Total cold run time: 100670 ms
Total hot run time: 29135 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4412	4297	4287	4287
q2	285	319	220	220
q3	4544	4946	4413	4413
q4	2194	2260	1433	1433
q5	4301	4161	4171	4161
q6	233	178	131	131
q7	1747	1615	1435	1435
q8	2982	2423	2313	2313
q9	7545	7514	7606	7514
q10	4310	4339	3891	3891
q11	588	417	405	405
q12	720	750	502	502
q13	3365	3561	2952	2952
q14	294	306	263	263
q15	q16	712	722	621	621
q17	1381	1369	1353	1353
q18	12186	11150	11877	11150
q19	1266	1152	1153	1152
q20	2245	2230	1916	1916
q21	5888	4977	4861	4861
q22	569	490	420	420
Total cold run time: 61767 ms
Total hot run time: 55393 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 166731 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 9b7c7f3bb9fb3ac08fcdafc0e330eacbf6559da1, data reload: false

query5	4317	595	443	443
query6	470	227	216	216
query7	4944	590	343	343
query8	322	173	154	154
query9	8816	4106	4077	4077
query10	468	363	302	302
query11	5760	2181	1974	1974
query12	154	103	93	93
query13	1258	605	436	436
query14	6054	4349	4019	4019
query14_1	3834	3836	3850	3836
query15	206	189	177	177
query16	996	499	508	499
query17	919	697	544	544
query18	2444	471	358	358
query19	206	191	151	151
query20	108	105	101	101
query21	243	163	142	142
query22	13105	13082	12973	12973
query23	15820	15016	14498	14498
query23_1	14694	14698	14602	14602
query24	7616	1721	1260	1260
query24_1	1264	1275	1262	1262
query25	573	472	398	398
query26	1318	353	222	222
query27	2600	624	389	389
query28	4557	2067	2036	2036
query29	1108	664	537	537
query30	343	275	229	229
query31	1180	1122	1036	1036
query32	127	65	61	61
query33	529	317	238	238
query34	1213	1126	610	610
query35	733	763	643	643
query36	772	790	700	700
query37	160	110	91	91
query38	1841	1767	1689	1689
query39	822	825	795	795
query39_1	778	779	783	779
query40	252	164	145	145
query41	67	66	70	66
query42	99	94	95	94
query43	337	339	291	291
query44	1497	787	768	768
query45	194	174	172	172
query46	1077	1174	754	754
query47	1562	1487	1476	1476
query48	381	431	315	315
query49	579	413	307	307
query50	1081	453	349	349
query51	10738	10602	10590	10590
query52	89	93	76	76
query53	271	278	203	203
query54	291	242	234	234
query55	75	80	86	80
query56	292	309	308	308
query57	1019	996	932	932
query58	297	251	252	251
query59	1528	1636	1415	1415
query60	315	275	255	255
query61	174	153	152	152
query62	405	322	268	268
query63	242	201	204	201
query64	2861	1054	873	873
query65	3895	3831	3813	3813
query66	1838	482	353	353
query67	28390	28263	27301	27301
query68	3586	1601	966	966
query69	422	301	263	263
query70	877	818	796	796
query71	375	315	314	314
query72	3104	2891	2558	2558
query73	853	791	446	446
query74	4682	4517	4346	4346
query75	2400	2358	2002	2002
query76	2431	1171	746	746
query77	362	385	288	288
query78	11244	11095	10554	10554
query79	1453	1188	790	790
query80	1369	559	467	467
query81	577	329	289	289
query82	645	179	136	136
query83	412	321	303	303
query84	332	159	130	130
query85	1033	612	553	553
query86	412	236	229	229
query87	1985	1984	1831	1831
query88	3715	2819	2784	2784
query89	395	339	282	282
query90	1992	196	199	196
query91	216	203	166	166
query92	66	62	58	58
query93	1540	1586	988	988
query94	707	367	338	338
query95	799	504	506	504
query96	1098	840	344	344
query97	2440	2450	2344	2344
query98	200	193	185	185
query99	743	729	626	626
Total cold run time: 255214 ms
Total hot run time: 166731 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 23.8 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 9b7c7f3bb9fb3ac08fcdafc0e330eacbf6559da1, data reload: false

query1	0.01	0.01	0.00
query2	0.10	0.05	0.05
query3	0.25	0.13	0.13
query4	1.60	0.14	0.14
query5	0.25	0.21	0.22
query6	1.16	0.78	0.80
query7	0.04	0.01	0.01
query8	0.06	0.03	0.04
query9	0.39	0.31	0.30
query10	0.56	0.58	0.55
query11	0.20	0.14	0.14
query12	0.18	0.13	0.15
query13	0.47	0.45	0.47
query14	1.00	0.99	0.99
query15	0.60	0.59	0.58
query16	0.33	0.33	0.33
query17	1.12	1.06	1.09
query18	0.23	0.21	0.19
query19	2.08	1.92	2.01
query20	0.02	0.02	0.01
query21	15.47	0.21	0.14
query22	4.94	0.06	0.05
query23	16.13	0.31	0.12
query24	2.94	0.41	0.33
query25	0.09	0.06	0.04
query26	0.72	0.22	0.14
query27	0.04	0.04	0.04
query28	3.56	0.83	0.34
query29	12.49	4.08	3.19
query30	0.27	0.15	0.16
query31	2.77	0.56	0.32
query32	3.22	0.59	0.48
query33	3.22	3.24	3.16
query34	15.59	3.98	3.30
query35	3.24	3.21	3.22
query36	0.54	0.44	0.43
query37	0.08	0.07	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.16	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.39 s
Total hot run time: 23.8 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 59.78% (26083/43628)
Line Coverage 44.11% (264568/599836)
Region Coverage 39.87% (210780/528643)
Branch Coverage 41.28% (96505/233792)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (12/12) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 75.92% (32297/42541)
Line Coverage 60.72% (361784/595775)
Region Coverage 57.19% (303285/530330)
Branch Coverage 58.62% (137046/233784)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants